/*************************************************************************
 *
 *   file		: ModPowerRegen.cs
 *   copyright		: (C) The WCell Team
 *   email		: info@wcell.org
 *   last changed	: $LastChangedDate: 2009-06-12 20:37:34 +0100 (Fri, 12 Jun 2009) $
 *   last author	: $LastChangedBy: dominikseifert $
 *   revision		: $Rev: 965 $
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *************************************************************************/

using WCell.Constants;
using WCell.Constants.Spells;
using WCell.RealmServer.Entities;

namespace WCell.RealmServer.Spells.Auras.Handlers
{
	public class ModPowerRegenHandler : AuraEffectHandler
	{
		protected internal override void CheckInitialize(WorldObject caster, Unit target, ref SpellFailedReason failReason)
		{
			var type = (PowerType)m_spellEffect.MiscValue;
			if (target.PowerType != type)
			{
				failReason = SpellFailedReason.BadTargets;
			}
		}

		protected internal override void Apply()
		{
			m_aura.Auras.Owner.Energize(m_aura.Caster, EffectValue, m_spellEffect);
		}
	}
};
